﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using DXTools.UI.Modules.Statistics.ViewModels;
using DXTools.UI.Core.View;
using DXTools.UI.Core;

using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Unity;
using DXTools.UI.Modules.Statistics.Views;
using DXTools.UI.Core.Events;
using DXTools.UI.Core.ViewModel;

namespace DXTools.UI.Modules.Statistics.Views
{
    public partial class EntitiesView : ViewBase
    {
        public EntitiesView(EntitiesViewModel viewModel)
            : base(viewModel)
        {
            InitializeComponent();
            this.DataContext = viewModel;
        }

        private void LoadEntity(object sender, RoutedEventArgs e)
        {
            //string viewName = Convert.ToString(((HyperlinkButton)e.OriginalSource).Content);
            //IRegion bodyRegion = ((EntitiesViewModel)this.DataContext).RegionManager.Regions[RegionNames.BODY_REGION];
            //object view = bodyRegion.GetView(viewName);
            //if (view == null)
            //{

            //    EntityView newView = ((EntitiesViewModel)this.DataContext).UnityContainer.Resolve<EntityView>();
            //    bodyRegion.Add(newView, viewName);
            //    bodyRegion.Activate(newView);
            //    ((EntitiesViewModel)this.DataContext).EventAggregator.GetEvent<ViewAddedEvent>().Publish(newView);
            //    newView.SetEntityName(viewName);
            //}
            //else
            //    bodyRegion.Activate(view);

        }

    }
}
